// import com.alibaba.druid.sql.SQLUtils;
// import com.alibaba.druid.sql.ast.SQLDataType;
// import com.alibaba.druid.sql.ast.SQLObjectImpl;
// import com.alibaba.druid.sql.dialect.oracle.visitor.OracleASTVisitor;
// import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "OracleSQLObjectImpl.h"
#include "../../../SQLUtils.h"
#include "../../../ast/SQLDataType.h"
#include "../../../visitor/SQLASTVisitor.h"
#include "../../../visitor/SQLASTOutputVisitor.h"
#include "../visitor/OracleASTVisitor.h"
#include "../../../../utils/instanceof.h"
#include "../../../../Exception/UnsupportedOperationException.h"

OracleSQLObjectImpl::OracleSQLObjectImpl()
{
}

// @Override
void OracleSQLObjectImpl::accept0(SQLASTVisitor_ptr v)
{
  if (instanceof <SQLASTVisitor, OracleASTVisitor>(v))
  {
    this->accept0(std::dynamic_pointer_cast<OracleASTVisitor>(v));
    return;
  }

  if (instanceof <SQLASTVisitor, SQLASTOutputVisitor>(v))
  {
    (std::dynamic_pointer_cast<SQLASTOutputVisitor>(v))->print(this->toString());
  }
}

void OracleSQLObjectImpl::accept0(OracleASTVisitor_ptr visitor) {}

SQLObject_ptr OracleSQLObjectImpl::clone()
{
  throw new UnsupportedOperationException(this->getClass());
}

SQLDataType_ptr OracleSQLObjectImpl::computeDataType()
{
  return nullptr;
}

string_ptr OracleSQLObjectImpl::toString()
{
  return SQLUtils::toOracleString(SharedObject(OracleSQLObjectImpl));
}
